package com.json;

import net.sf.json.JSONObject;  

/**
 * json转java对象
 * 同步测试该注释可删除
 * @author Administrator
 *
 */
public class JsonToEntity {
	public static void main(String[] args) {
		String jsonStr="{\"userId\":\"78978989899\",\"userOrgId\":\"100222\",\"authorities\":[{\"authority\":\"admin\"},{\"aurthority\":\"user\"}],\"dataScope\":\"all\"}";
		
		JSONObject jsonobject = JSONObject.fromObject(jsonStr);
		User user= (User)JSONObject.toBean(jsonobject,User.class);
		
		System.out.println(user.getUserId());
	
	}
}
